3 require_once('modules/UpgradeWizard/uw_utils.php');
5 class Bug42643Test extends Sugar_PHPUnit_Framework_TestCase
7 var $has_notification_studio_file = false;
8 var $studio_file = 'modules/Help/Forms.php';
11 public function setUp()
14 if(file_exists($this->studio_file))
16 //This really shouldn't be happening, but just in case...
17 $this->has_notification_studio_file = true;
18 $this->backup_file = $this->studio_file . '.' . gmmktime() . '.bak';
19 copy($this->studio_file, $this->backup_file);
21 //Create the test file
22 write_array_to_file("test", array(), $this->studio_file);
26 public function tearDown()
28 if($this->has_notification_studio_file)
30 copy($this->backup_file, $this->studio_file);
31 unlink($this->backup_file);
33 if(file_exists($this->studio_file))
35 unlink($this->studio_file);
40 public function testUnlinkUpgradeFilesPre614()
42 $this->assertTrue(file_exists($this->studio_file), 'Assert the ' . $this->studio_file . ' exists');
43 unlinkUpgradeFiles('610');
44 $this->assertFalse(file_exists($this->studio_file), 'Assert the ' . $this->studio_file . ' no longer exists');